package com.zygh.policeasset.service;

import com.zygh.policeasset.component.CommonResult;
import com.zygh.policeasset.mapper.MaintenanceMapper;
import com.zygh.policeasset.pojo.Maintenance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/service/MaintenanceService.class */
public class MaintenanceService {
    @Autowired
    MaintenanceMapper maintenanceMapper;

    public Maintenance queryById(Integer id) {
        return this.maintenanceMapper.queryById(id);
    }

    public CommonResult insert(Maintenance maintenance) {
        if (this.maintenanceMapper.insert(maintenance) > 0) {
            return new CommonResult().success();
        }
        return new CommonResult().validateFailed("添加失败");
    }

    public CommonResult update(Maintenance maintenance) {
        if (this.maintenanceMapper.update(maintenance) > 0) {
            return new CommonResult().success();
        }
        return new CommonResult().validateFailed("修改失败");
    }
}